package com.base.web.auth.service.impl;


import com.base.web.auth.service.LogService;
import com.base.web.core.basic.service.BasicServiceImpl;
import com.base.web.dao.master.auth.LogMapper;
import com.base.web.model.master.auth.Log;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
 * Created with IntelliJ IDEA.
 * Description:
 *
 * @author: RENTIE
 * Date: 2018-07-05 8:57
 */
@Service
public class LogServiceImpl extends BasicServiceImpl<Log> implements LogService {

    @Resource
    private LogMapper logMapper;

    @Override
    public PageInfo<Log> select(Map<String, String> map) {
        Integer currentPage = Integer.valueOf(map.get("page"));
        Integer pageSize = Integer.valueOf(map.get("limit"));
        PageHelper.startPage(currentPage, pageSize);
        List<Log> list = logMapper.selectList(map);
        return new PageInfo<Log>(list);
    }
}
